package com.jf.ai.etl.transformers;

import org.springframework.ai.chat.model.ChatModel;
import org.springframework.ai.document.Document;
import org.springframework.ai.model.transformer.KeywordMetadataEnricher;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User:22954
 * Date:2025-07-22
 * Time:19:04
 */
@Component
public class JfKeywordEnricher {
    private final ChatModel chatModel;
    public JfKeywordEnricher(ChatModel chatModel) {
        this.chatModel = chatModel;
    }
    public List<Document> enrichDocuments(List<Document> documents, Integer keywordCount) {
        KeywordMetadataEnricher enricher = new KeywordMetadataEnricher(this.chatModel, keywordCount);
        return enricher.apply(documents);
    }
}
